home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Interfaces / PInterfaces / ADSPSecure.p next >
Encoding:
Text File  |  1993-11-10  |  4.1 KB  |  154 lines  |  [TEXT/MPS ]

  1. {***********************************************************
  2.  
  3. Created: Sunday, June 6, 1993 at 3:00PM
  4.  ADSPSecure.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1993
  8.   All rights reserved
  9.  
  10. ***********************************************************}
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes:= 0}
  15. {$ENDC}
  16.  
  17. {$IFC NOT UsingIncludes}
  18.     UNIT ADSPSecure;
  19.     INTERFACE
  20. {$ENDC}
  21.  
  22. {$IFC UNDEFINED UsingADSPSecure}
  23. {$SETC UsingADSPSecure:= 1}
  24.  
  25. {$I+}
  26. {$SETC ADSPSecureIncludes:= UsingIncludes}
  27. {$SETC UsingIncludes:= 1}
  28.  
  29.  
  30. {$IFC UNDEFINED UsingADSP}
  31. {$I $$Shell(PInterfaces)ADSP.p}
  32. {$ENDC}
  33.  
  34. {$IFC UNDEFINED UsingFiles}
  35. {$I $$Shell(PInterfaces)Files.p}
  36. {$ENDC}
  37.  
  38. {$IFC UNDEFINED UsingOCE}
  39. {$I OCE.p}
  40. {$ENDC}
  41.  
  42. {$IFC UNDEFINED UsingOCEAuthDir}
  43. {$I OCEAuthDir.p}
  44. {$ENDC}
  45.  
  46. {$IFC UNDEFINED UsingTypes}
  47. {$I $$Shell(PInterfaces)Types.p}
  48. {$ENDC}
  49.  
  50. {$SETC UsingIncludes:= ADSPSecureIncludes}
  51.  
  52.  
  53. { New ADSP control codes }
  54.  
  55. CONST
  56. sdspOpen        = 229;                    { open a secure connection }
  57.  
  58.  
  59.  
  60.  
  61.  
  62. {
  63. For secure connections, the eom field of ioParams contains two single-bit flags
  64. (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  65. eom flag.  All other bits in that field should be zero.
  66.  
  67. To write an encrypted message, you must set an encrypt bit in the eom field of
  68. the ioParams of your write call. Note: this flag is only checked on the first
  69. write of a message (the first write on a connection, or the first write following
  70. a write with eom set.
  71. }
  72.  
  73. dspEOMBit = 0;                            { set if EOM at end of write }
  74. dspEncryptBit = 1;                        { set to encrypt message }
  75.  
  76.  
  77. dspEOMMask            = $1;  {1<<dspEOMBit}
  78. dspEncryptMask        = $2;  {1<<dspEncryptBit}
  79.  
  80.  
  81.  
  82.  
  83.  
  84. {
  85. Define an ADSPSecure parameter block, as used for the secure Open call.
  86. }
  87.  
  88. sdspWorkSize    = 2048;                    { size of ADSPSecure workspace }
  89.  
  90. TYPE
  91. TRSecureParams = PACKED RECORD
  92.     localCID: INTEGER;                    { local connection id }
  93.     remoteCID: INTEGER;                    { remote connection id }
  94.     remoteAddress: AddrBlock;            { address of remote end }
  95.     filterAddress: AddrBlock;            { address filter }
  96.     sendSeq: LONGINT;                    { local send sequence number }
  97.     sendWindow: INTEGER;                { send window size }
  98.     recvSeq: LONGINT;                    { receive sequence number }
  99.     attnSendSeq: LONGINT;                { attention send sequence number }
  100.     attnRecvSeq: LONGINT;                { attention receive sequence number }
  101.     ocMode: Byte;                        { open connection mode }
  102.     ocInterval: Byte;                    { open connection request retry interval }
  103.     ocMaximum: Byte;                    { open connection request retry maximum }
  104.     secure: BOOLEAN;                    {  --> TRUE if session was authenticated }
  105.     sessionKey: AuthKeyPtr;                { <--> encryption key for session }
  106.     credentialsSize: LONGINT;            {  --> length of credentials }
  107.     credentials: Ptr;                    {  --> pointer to credentials }
  108.     workspace: Ptr;                        {  --> pointer to workspace for connection }
  109.                                         { align on even boundary and length = sdspWorkSize }
  110.     recipient: AuthIdentity;            {  --> identity of recipient (or initiator if active mode }
  111.     issueTime: UTCTime;                    {  --> when credentials were issued }
  112.     expiry: UTCTime;                    {  --> when credentials expiry }
  113.     initiator: RecordIDPtr;                { <--  RecordID of initiator returned here.
  114.                                             Must give appropriate Buffer to hold RecordID
  115.                                             (Only for passive or accept mode) }
  116.     hasIntermediary: BOOLEAN;            { <--  will be set if credentials has an intermediary }
  117.     intermediary: RecordIDPtr;            { <--  RecordID of intermediary returned here.
  118.                                             (If intermediary is found in credentials
  119.                                             Must give appropriate Buffer to hold RecordID
  120.                                             (Only for passive or accept mode) }
  121.     END;
  122.  
  123.  
  124.  
  125.  
  126. SDSPParamBlock = PACKED RECORD
  127.     CASE INTEGER OF
  128.         1: (dspParamBlock: DSPParamBlock);
  129.         2: (qLink: QElemPtr;
  130.             qType: INTEGER;
  131.             ioTrap: INTEGER;
  132.             ioCmdAddr: Ptr;
  133.             ioCompletion: ProcPtr;
  134.             ioResult: OSErr;
  135.             ioNamePtr: StringPtr;
  136.             ioVRefNum: INTEGER;
  137.             ioCRefNum: INTEGER;                    { adsp driver refNum }
  138.             csCode: INTEGER;                    { adsp driver control code }
  139.             qStatus: LONGINT;                    { adsp internal use }
  140.             ccbRefNum: INTEGER;                    { connection end refNum }
  141.             secureParams: TRSecureParams;        { dspOpenSecure }
  142.             );
  143.     END;
  144.  
  145.  
  146. SDSPPBPtr = ^SDSPParamBlock;
  147.  
  148.  
  149. {$ENDC}    { UsingADSPSecure }
  150.  
  151. {$IFC NOT UsingIncludes}
  152.     END.
  153. {$ENDC}
  154.